package com.ruoyi.testDeal.controller;

import com.ruoyi.common.annotation.Log;
import com.ruoyi.common.core.controller.BaseController;
import com.ruoyi.common.core.domain.AjaxResult;
import com.ruoyi.common.core.page.TableDataInfo;
import com.ruoyi.common.enums.BusinessType;
import com.ruoyi.common.utils.poi.ExcelUtil;
import com.ruoyi.testDeal.domain.testYs.JkcrtshjYs;
import com.ruoyi.testDeal.service.IJkcrtshjYsService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import javax.servlet.http.HttpServletResponse;
import java.util.List;

/**
 * 金属非金属矿山在用缠绕式提升机检测报告验算信息Controller
 * 
 * @author ruoyi
 * @date 2024-03-29
 */
@RestController
@RequestMapping("/testDeal/jkCrtshjYs")
public class JkcrtshjYsController extends BaseController
{
    @Autowired
    private IJkcrtshjYsService jkcrtshjYsService;

    /**
     * 查询金属非金属矿山在用缠绕式提升机检测报告验算信息列表
     */
    @GetMapping("/list")
    public TableDataInfo list(JkcrtshjYs jkcrtshjYs)
    {
        startPage();
        List<JkcrtshjYs> list = jkcrtshjYsService.selectJkcrtshjYsList(jkcrtshjYs);
        return getDataTable(list);
    }

    /**
     * 导出金属非金属矿山在用缠绕式提升机检测报告验算信息列表
     */
    @Log(title = "金属非金属矿山在用缠绕式提升机检测报告验算信息", businessType = BusinessType.EXPORT)
    @PostMapping("/export")
    public void export(HttpServletResponse response, JkcrtshjYs jkcrtshjYs)
    {
        List<JkcrtshjYs> list = jkcrtshjYsService.selectJkcrtshjYsList(jkcrtshjYs);
        ExcelUtil<JkcrtshjYs> util = new ExcelUtil<JkcrtshjYs>(JkcrtshjYs.class);
        util.exportExcel(response, list, "金属非金属矿山在用缠绕式提升机检测报告验算信息数据");
    }

    /**
     * 获取金属非金属矿山在用缠绕式提升机检测报告验算信息详细信息
     */
    @GetMapping(value = "/{jkcrtshjYsId}")
    public AjaxResult getInfo(@PathVariable("jkcrtshjYsId") Long jkcrtshjYsId)
    {
        return success(jkcrtshjYsService.selectJkcrtshjYsByJkcrtshjYsId(jkcrtshjYsId));
    }

    /**
     * 新增金属非金属矿山在用缠绕式提升机检测报告验算信息
     */
    @Log(title = "金属非金属矿山在用缠绕式提升机检测报告验算信息", businessType = BusinessType.INSERT)
    @PostMapping
    public AjaxResult add(@RequestBody JkcrtshjYs jkcrtshjYs)
    {
        return toAjax(jkcrtshjYsService.insertJkcrtshjYs(jkcrtshjYs));
    }

    /**
     * 修改金属非金属矿山在用缠绕式提升机检测报告验算信息
     */
    @Log(title = "金属非金属矿山在用缠绕式提升机检测报告验算信息", businessType = BusinessType.UPDATE)
    @PutMapping
    public AjaxResult edit(@RequestBody JkcrtshjYs jkcrtshjYs)
    {
        return toAjax(jkcrtshjYsService.updateJkcrtshjYs(jkcrtshjYs));
    }

    /**
     * 删除金属非金属矿山在用缠绕式提升机检测报告验算信息
     */
    @Log(title = "金属非金属矿山在用缠绕式提升机检测报告验算信息", businessType = BusinessType.DELETE)
	@DeleteMapping("/{jkcrtshjYsIds}")
    public AjaxResult remove(@PathVariable Long[] jkcrtshjYsIds)
    {
        return toAjax(jkcrtshjYsService.deleteJkcrtshjYsByJkcrtshjYsIds(jkcrtshjYsIds));
    }
}
